<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>14_margin的注意事项4.html</title>
    <style>
      div {
        width: 300px;
        height: 100px;
        margin: 100px auto;
        background: url(../../imgs/IMG_3120.jpeg);
      }

      span {
        margin: 0 auto;
      }
    </style>
  </head>
  <body>
    <!-- margin的值也可以是auto，给一个块级元素左右margin设置auto可以实现该元素在其父元素内水平居中 -->
    <div>JavaScript</div>
    <span>好好学习</span>
  </body>
</html>
